<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>2d转换</title>
	<style>
		*{
			margin: 0;
			padding: 0;
		}
		.wrap{
			width: 200px;
			height: 300px;
			overflow: hidden;
			position: relative;
			background-color: #ccc;
			transition: all 1s;
			margin:0 auto;		
			margin-top: 100px;
		}
		.wrap .top{
			width: 200px;
			height: 100px;
			background-color: red;
		}
		.wrap .bot{
			width: 200px;
			height: 100px;
			background-color: green;
			position: absolute;
			left: 0;
			bottom: 0;
			-webkit-transform:translate(0,100px);
			transition: transform 1s; 
		}
		.wrap:hover{
			box-shadow: 3px 3px 3px black;
			-webkit-transform: translate(0,-20px);
		}
		.wrap:hover .bot{
			-webkit-transform:translate(0,0);
		}
	</style>
</head>
<body>
	<div class="wrap">
		<div class="top"></div>
		<div class="bot"></div>
	</div>
</body>
</html>